home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Milan_1991 / Devcon91.1 / Libraries / Commodities / LeftyMouse / app.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-01  |  8.0 KB  |  188 lines

  1.  
  2.    /***********************************************************************
  3.    *                                                                      *
  4.    *                            COPYRIGHTS                                *
  5.    *                                                                      *
  6.    *   Copyright (c) 1990  Commodore-Amiga, Inc.  All Rights Reserved.    *
  7.    *                                                                      *
  8.    ***********************************************************************/
  9.  
  10. #ifndef APP_H
  11. #define APP_H
  12.  
  13. #ifdef LATTICE
  14. #include <pragmas/gadtools_pragmas.h>
  15. #endif
  16. #include <clib/all_protos.h>
  17.  
  18. #include <utility/tagitem.h>
  19.  
  20. /**********************************************************************/
  21. /* Prototypes for functions declared in app.c and called from the     */
  22. /* standard modules.                                                  */
  23. /**********************************************************************/
  24. VOID setupCustomGadgets(struct Gadget **);
  25. VOID HandleGadget(ULONG,ULONG);
  26. VOID setupCustomMenu(VOID);
  27. VOID handleCustomMenu(UWORD);
  28. VOID refreshWindow(VOID);
  29. BOOL setupCustomCX(VOID);
  30. VOID handleCustomSignal(VOID);
  31. VOID shutdownCustomCX(VOID);
  32. VOID handleCustomCXMsg(ULONG);
  33. VOID handleCustomCXCommand(ULONG);
  34. VOID handleCustomSignal(VOID);
  35.  
  36. /**********************************************************************/
  37. /* Prototypes for functions declared in the standard modules and      */
  38. /* called by app.c                                                    */
  39. /**********************************************************************/
  40. VOID setupWindow(VOID);
  41. VOID shutdownWindow(VOID);
  42. VOID terminate(VOID);
  43.  
  44. /**********************************************************************/
  45. /* Prototypes for functions declared in application modules and       */
  46. /* called by app.c                                                    */
  47. /**********************************************************************/
  48. BOOL setupLeftyMouse(VOID);
  49.  
  50. /**********************************************************************/
  51. /* definitions for global variables declared in the standard modules  */
  52. /* referenced by app.c                                                */
  53. /**********************************************************************/
  54. extern CxObj                  *broker;
  55. extern SHORT                  topborder;
  56. extern VOID                   *vi;
  57. extern struct Menu            *menu;
  58. extern struct Library         *GadToolsBase;
  59. extern struct Gadget          *glist;
  60. extern char                   **ttypes;
  61. extern struct MsgPort         *cxport;
  62. extern struct IntuitionBase   *IntuitionBase;
  63. extern struct DrawInfo        *mydi;
  64. extern ULONG                  csigflag;
  65. extern struct Task            *maintask;
  66. extern BOOL                   IDCMPRefresh;
  67.  
  68. /**********************************************************************/
  69. /* definitions for global variables declared in app.c and             */
  70. /* referenced by the standard modules.                                */
  71. /**********************************************************************/
  72. extern struct TextAttr mydesiredfont;
  73.  
  74. /**********************************************************************/
  75. /* Commodities specific definitions.                                  */
  76. /*                                                                    */
  77. /* COM_NAME  - used for the scrolling display in the Exchange program */
  78. /* COM_TITLE - used for the window title bar and the long description */
  79. /*             in the Exchange program                                */
  80. /* COM_DESC  - Commodity description used by the Exchange program     */
  81. /* CX_DEFAULT_PRIORITY - default priority for this commodities broker */
  82. /*                       can be overidden by using icon TOOL TYPES    */
  83. /**********************************************************************/
  84. #define COM_NAME  "leftymouse"
  85. #define COM_TITLE "LeftyMouse"
  86. #define COM_DESCR "Swaps Mouse Buttons For Leftys"
  87. #define CX_DEFAULT_PRIORITY 0
  88. #define CX_DEFAULT_POP_KEY ("shift f1")
  89. #define CX_DEFAULT_POP_ON_START ("YES")
  90.  
  91. /**********************************************************************/
  92. /* Custom Signal control                                                     */
  93. /*                                                                    */
  94. /* If CSIGNAL = 0 then this commodity will NOT have a custom signal   */
  95. /* If CSIGNAL = 1 this commodity will support a custom signal         */
  96. /**********************************************************************/
  97. #define CSIGNAL 0
  98.  
  99. /**********************************************************************/
  100. /* Window control                                                     */
  101. /*                                                                    */
  102. /* If WINDOW = 0 then this commodity will NOT have a popup window     */
  103. /* If WINDOW = 1 this commodity will support a popup window with the  */
  104. /*               attributes defined below.                            */
  105. /**********************************************************************/
  106. #define WINDOW 0
  107.  
  108. #if WINDOW
  109. #define W(x) x
  110. #else
  111. #define W(x) ;
  112. #endif
  113.  
  114. #if WINDOW
  115.  
  116. extern struct Window   *window; /* our window */
  117. extern struct TextFont *font;
  118.  
  119. #define WINDOW_LEFT   134
  120. #define WINDOW_TOP    64
  121. #define WINDOW_WIDTH  362
  122. #define WINDOW_HEIGHT 68
  123. #define WINDOW_INNERHEIGHT 70
  124.  
  125. #define WINDOW_SIZING 0
  126. #if WINDOW_SIZING
  127. #define WINDOW_MAX_WIDTH  -1
  128. #define WINDOW_MIN_WIDTH  50
  129. #define WINDOW_MAX_HEIGHT -1
  130. #define WINDOW_MIN_HEIGHT 30
  131. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWSIZING | WINDOWDEPTH | SIMPLE_REFRESH )
  132. #else
  133. #define WINDOW_MAX_WIDTH  WINDOW_WIDTH
  134. #define WINDOW_MIN_WIDTH  WINDOW_WIDTH
  135. #define WINDOW_MAX_HEIGHT WINDOW_HEIGHT
  136. #define WINDOW_MIN_HEIGHT WINDOW_HEIGHT
  137. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWDEPTH | SIMPLE_REFRESH )
  138. #endif  /* WINDOW_SIZING */
  139.  
  140. #define IFLAGS (MENUPICK | MOUSEBUTTONS | GADGETUP | GADGETDOWN | MOUSEMOVE | CLOSEWINDOW | REFRESHWINDOW )
  141.  
  142.                                      /* hotkey definitions                */
  143. #define POP_KEY_ID     (86L)         /* pop up identifier                 */
  144.  
  145. /**********************************************************************/
  146. /* Gadget control                                                     */
  147. /*                                                                    */
  148. /* Here are the gadget specific definitions. Note that these are      */
  149. /* included only if WINDOW=1 since gadgets make no sense without a    */
  150. /* window.                                                            */
  151. /**********************************************************************/
  152. #define GAD_HIDE     1
  153. #define GAD_DIE      2
  154.  
  155. /**********************************************************************/
  156. /* Menu control                                                       */
  157. /*                                                                    */
  158. /* Here are the menu specific definitions. Note that these are        */
  159. /* included only if WINDOW=1 since menus make no sense without a      */
  160. /* window.                                                            */
  161. /**********************************************************************/
  162. #define MENU_HIDE     1
  163. #define MENU_DIE      2
  164.  
  165. #endif  /* WINDOW */
  166.  
  167. /**********************************************************************/
  168. /* Debug control                                                      */
  169. /*                                                                    */
  170. /* The first define converts any printfs that got in by mistake into  */
  171. /* kprintfs. If you are debuging to the console you can change        */
  172. /* kprintfs into printfs.                                             */
  173. /* The D1(x) define controls debugging in the standard modules. Use   */
  174. /* The D(x) macro for debugging in the app.c module.                  */
  175. /**********************************************************************/
  176. void kprintf(char *,...);
  177. #define printf kprintf
  178.  
  179. #ifdef DEBUG
  180. #define D1(x) x
  181. #define D(x)  x
  182. #else
  183. #define D1(x) ;
  184. #define D(x)  ;
  185. #endif /* NO DEBUG */
  186.  
  187. #endif /* APP_H */
  188.